package com.access.boot.autoconfigure.apisdk;

import com.access.boot.autoconfigure.apisdk.proxy.AccessorFactoryBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Yangzhen
 * @date 2022/5/28 16:09
 * @since 1.0.0
 */
@Configuration
@EnableConfigurationProperties(GlobalConfiguration.class)
public class AccessorConfig {

    @Bean
    @ConditionalOnMissingBean
    public AccessorFactoryBean accessorFactoryBean(GlobalConfiguration globalConfiguration) {
        AccessorFactoryBean factory = new AccessorFactoryBean(globalConfiguration);
        return factory;
    }

}
